﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>登陆</title>

    <meta name="description" content="login page" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="shortcut icon" href="assets/img/favicon.png" type="image/x-icon">
    <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
    <link id="bootstrap-rtl-link" href="" rel="stylesheet" />
    <link href="assets/css/font-awesome.min.css" rel="stylesheet" />
    <!--<link href="http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,600,700,300" rel="stylesheet" type="text/css">-->
    <link id="beyond-link" href="assets/css/beyond.min.css" rel="stylesheet" />
    <link href="assets/css/demo.min.css" rel="stylesheet" />
    <link href="assets/css/animate.min.css" rel="stylesheet" />
    <link id="skin-link" href="" rel="stylesheet" type="text/css" />
    <script src="assets/js/skins.min.js"></script>
</head>
<body>
<div class="login-container animated fadeInDown">
    <div class="loginbox bg-white">
        <div class="loginbox-title">登陆</div>
        <div class="loginbox-social">
            <div class="social-title ">仅限后端数据维护使用</div>
            <div class="social-buttons">
                <a href="" class="button-facebook">
                    <i class="social-icon fa fa-facebook"></i>
                </a>
                <a href="" class="button-twitter">
                    <i class="social-icon fa fa-twitter"></i>
                </a>
                <a href="" class="button-google">
                    <i class="social-icon fa fa-google-plus"></i>
                </a>
            </div>
        </div>
        <div class="loginbox-or">
            <div class="or-line"></div>
            <div class="or">OR</div>
        </div>
        <div class="loginbox-textbox">
            <input type="text" class="form-control" placeholder="账户" id="acount"/>
        </div>
        <div class="loginbox-textbox">
            <input type="password" class="form-control" placeholder="密码" id="password"/>
        </div>
        <div class="loginbox-forgot">
            <a href="">忘记密码?</a>
        </div>
        <div class="loginbox-submit">
            <button type="button" class="btn btn-primary btn-block" onclick="javascript:login()">登陆</button>
        </div>
        <!--<div class="loginbox-signup">
            <a href="">用邮箱登陆</a>
        </div>-->
    </div>
    <div class="logobox">

    </div>

<script src="assets/js/jquery-2.0.3.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/beyond.min.js"></script>
<script src="assets/js/toastr/toastr.js"></script>
<script type="application/javascript">
    function login(){
        $.ajax({
            type:"POST",
            url:"rest/v1/login?name="+$('#acount').val()+"&pwd="+$('#password').val(),
            datatype: "json",
            success:function(data){
                window.location="index.html?token="+window.btoa(data.result);
            },
            error: function(error) {
                var obj = jQuery.parseJSON(error.responseText);
                Notify(obj.message, 'top-right', '800', 'warning', 'fa-bolt', true);
            }
        });
    }

    $(function(){
        document.onkeydown = function(e){
            var ev = document.all ? window.event : e;
            if(ev.keyCode==13) {
                login();
            }
        }
    });

    /*var baseReqUrl;
    window.onload = function(){
        $.getJSON("config/config.json",function(data){
            baseReqUrl = data.reqUrl;
        });
    }*/
</script>
</body>
</html>
